<%--
  Created by IntelliJ IDEA.
  User: jshand
  Date: 2022-10-19
  Time: 14:47
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java"     %>
<%@ page import="com.neuedu.web.dao.UserDao" %>
<%@ page import="com.neuedu.web.entity.User" %>
<%@ page import="java.util.List" %>


<%!
    int numa  = 100;
%>
<html>
<head>
    <title>Title</title>
</head>
<body>



  <a href='userAdd'>添加</a> 							
  <table width='100%' border='1' cellpadding='0' cellspacing='0' >							
      	<tr>                      
          		<td>序号</td>         
          		<td>用户名</td>       
          		<td>密码</td>         
          		<td>昵称</td>         
          		<td>出生日期</td>     
          		<td>email</td>        
          		<td>电话号</td>
          		<td>操作</td>
          	</tr>
               <%
                   UserDao userDao = new UserDao();
                   String sql = " select * from user";
                   Object[] params = {};
                   List<User> users = userDao.selectList(sql, params);
                   for (int i = 0; i < users.size(); i++) {
                       User user = users.get(i);

                       int abc = 10;
               %>
                    <tr>

<%--                        <%=i%>   == out.write(i)--%>
                            <td><%=i%></td>
                            <td><%=user.getUsername()%></td>
                            <td><%=user.getPassword()%></td>
                            <td><%=user.getDisplayname()%></td>
                            <td><%=user.getBirthday()%></td>
                            <td><%=user.getEmail()%></td>
                            <td><%=user.getTelephone()%></td>
                            <td><%=user.getUsername()%></td>

                            <td><a href='userDelete?id=<%=user.getId()%>' >删除</a> &nbsp;&nbsp;  <a href='userEdit?id=<%=user.getId()%>' >更新</a></td>
                       </tr>
                   <%}%>
                                        
          	</table>                  

</body>
</html>
